﻿//---------------------------------------------------------------------------
// 
// File: HtmlTokenType.cs
//
// Copyright (C) Microsoft Corporation.  All rights reserved.
//
// Description: Definition of token types supported by HtmlLexicalAnalyzer
//
//---------------------------------------------------------------------------

namespace HTMLConverter.XamlConverters
{
    using System.Xml.Linq;
    using HTMLConverter.Xml;

    /// <summary>
    /// HtmlToXamlConverter is a static class that takes an HTML string
    /// and converts it into XAML
    /// </summary>
    internal class BoldConverter : IConverter
    {
        public Tag Type
        {
            get { return Tag.Bold; }
        }

        public XmlElement Convert(XNode htmlNode)
        {
            XmlElement run = Converters.Collection[Tag.Run].Convert(htmlNode);
            if (run != null)
            {
                // FontWeight="Bold"
                run.SetAttribute(HtmlConverter.Xaml_FontWeight, HtmlConverter.Xaml_FontWeight_Bold);
            }

            return run;
        }
    }
}
